from rest_framework.filters import SearchFilter


class Seacher(SearchFilter):
    def get_search_terms(self, request):
        #把参数名字search换成keyword
        params = request.query_params.get('keyword')
        if params:
        # 删除出现的别的字符，，，将出现的字符换成空的
            params = params.replace('\x00','')
            params = params.replace(',','')
            return params.split()
        return params